package com.gyao.user;

import com.gyao.orm.conf.SwaggerConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Import;

/**
 * 订单模启动类
 *
 * @author qiusn
 * @date 2020-01-08
 */
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan(basePackages = "package com.gyao.orm.mapper")
@Import(SwaggerConfig.class)
public class UserApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class, args);
    }


//    @Autowired
//    private Environment env;
//    @Bean
//    public MybatisSqlSessionFactoryBean setSqlSessionFactory(DataSource dataSource) throws IOException {
//        MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
//        // 设置数据源
//        bean.setDataSource(dataSource);
//        // 简化PO的引用
//        bean.setTypeAliasesPackage(env.getProperty("gyao.type-vo"));//这里我打码了，写你项目PO的包
//        bean.setTypeAliasesPackage(env.getProperty("gyao.type-aliases-package"));
//        bean.setMapperLocations(new PathMatchingResourcePatternResolver()
//                .getResources(env.getProperty("gyao.mapper-locations")));
//        return bean;
//    }

}
